-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array plotting #784
Array plotting #784
Conversation
- labels are not plotted is they are outside the selected region - plotting arrows considering the timing parameters - functions are now working for diffuse, point, N & S pointing simtel files - arrows had a not very clear behaviour. Changed to a simpler one (fixed length).
Codecov Report
@@ Coverage Diff @@
## master #784 +/- ##
==========================================
+ Coverage 71.54% 71.54% +<.01%
==========================================
Files 199 199
Lines 10824 10843 +19
==========================================
+ Hits 7744 7758 +14
- Misses 3080 3085 +5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this plotting still work if you can't yet calculated the time gradient dictionary? It would be nice if it can still be used if not (e.g. have it still do something sensible if None is passed for time_gradient
.
I think that we should plot the arrow only if we can be confident about which direction we are watching at: if we are not confident about this, then the line plotting function should be used. |
You can get the direction from the geometric asymmetry as well as the time gradient, so that could be used as well - it would be nice to show either one. The main reason is that we are not guaranteed to have time information, e.g. when we look at data from HESS or early Astri camera simulations |
You could also have it just draw lines, not vectors, in the case that the time_gradient is not given |
I tried to use the skewness to have the information regarding the time gradient but I don't get really nice results. I think that for the moment I can make the function draw an arrow if the gradient is given, and draw lines if the gradient is either not given (the |
You could just give it a |
So @maxnoe: +1 is the arrow, -1 is the flipped arrow and 0 is the line? and it's up to the user decide which is the discriminator (time, skewness, or whatever)? |
Yes, that was my idea. What do you think? |
I think that having this as more general as possible is better: I can add a use case with the sign of the time gradient in the notebook that I created. |
* master: (60 commits) Add test that shows slicing breaks cam geom and fix it (cta-observatory#782) fix ctapipe build failure (cta-observatory#811) fix package name for yaml (should be pyyaml) (cta-observatory#810) Implement number of islands (cta-observatory#801) fixed ranges of cam-display so they correspond to fixed toymodel sims (cta-observatory#808) Fix unknown section example warning (cta-observatory#800) Fix timing parameters for case when there are negative values in image (cta-observatory#804) Update Timing Parameters (cta-observatory#799) speed up unit tests that use test_event fixture (cta-observatory#798) Add unit to h_max in HillasReconstructor (cta-observatory#797) Codacy code style improvements (cta-observatory#796) Minor changes: mostly deprecationwarning fixes (cta-observatory#787) Array plotting (cta-observatory#784) added a config file for github change-drafter plugin (cta-observatory#795) Simple HESS adaptations (cta-observatory#794) add test for sliced geometries for hillas calculation (cta-observatory#781) Impact intersection (cta-observatory#778) updated main documentation page (cta-observatory#792) Implement concentration image features (cta-observatory#791) Fix bad builds by changing channel name (missing pyqt package) (cta-observatory#793) ... # Conflicts: # ctapipe/calib/camera/dl1.py
This PR is a connected to some other PRs (#723, #737 and #771).
I recently merged #771 where i corrected the angle (phi to psi) used to plot the arrow on the ground, changing the arrow with a line.
Since the arrow was not being plotted correctly, I worked a bit on a correct plotting for the arrow on the ground and I fixed some bugs in a already existing function used to calculate the time gradient on some selected pixels (usually those selected after the cleaning).
I also added an example notebook (thanks to @vuillaut for providing an example to work on) which displays both the cameras (image + hillas, peakpos and selected region which is being considered for the computation of the gradient) and the arrows on the ground (only if the gradient is not zero, otherwise only the line from the hillas parametrization can be plotted).
Here's an image of how it looks like now (from the example file in ctapipe):
I also added an option to the labels in order to plot only the labels inside the desired region (and not all of them as it was before even only a smaller region was selected).
Since the arrows had a strange length, i added some options and changed a bit the code to make it similar to the line plotting: now the length of the arrow can be selected manually.
Open to suggestions and improvements.